package com.xja.book.service.impl;

import com.xja.book.entity.BookType;
import com.xja.book.mapper.BookTypeMapper;
import com.xja.book.service.BookTypeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service("bookTypeService")
public class BookTypeServiceImpl implements BookTypeService {
    @Autowired
    private BookTypeMapper bookTypeMapper;
    public List<BookType> findBookTypes() throws Exception {
        return bookTypeMapper.selectAll();
    }

    public void addBookType(BookType type) throws Exception {
        bookTypeMapper.insert(type);
    }

    public void deleteBookType(Integer typeId) throws Exception {
        bookTypeMapper.deleteByPrimaryKey(typeId);
    }
}
